<template>
	<view v-if="pageShow" class="container">
		<scroll-view scroll-y="true" style="height: 100%;" :refresher-threshold="50" :refresher-background="'#F7F7F7'"
			:refresher-enabled="true" :refresher-triggered="isRefreshing" @refresherrefresh="refresherrefresh"
			@scrolltolower="loadMore">
			<view class="my-demand">
				<view class="demand-item" v-for="(item, index) in demandList" :key="index" @click="goDemandDetail(item)">
					<view class="header">
						<view class="header-left">
							<image
								src="https://xzcs-public-files.oss-cn-beijing.aliyuncs.com/static/enterprise-service/demand/demand-icon.png"
								class="icon"></image>
							<text style="margin-left: 20rpx;">{{ item.name }}</text>
						</view>
						<view class="header-right">
							<text :class="item.status === 0 ? 'color1' : 'color2'">{{ item.status === 0 ? '进行中' : item.status === 1 ?
								'已完成' : '已关闭' }}</text>
						</view>
					</view>
					<view class="content">
						<view class="content-item">
							<text class="cuIcon-title"></text>
							<text style="margin-left: 30rpx;">发布时间：</text>
							<text>{{ item.time }}</text>
						</view>
						<view class="content-item">
							<text class="cuIcon-title"></text>
							<text style="margin-left: 30rpx;">服务地址：</text>
							<text>{{ item.city_name }}</text>
						</view>
					</view>
					<view v-if="item.status === 0 || item.status === 2" class="bottom-btn_new">
						<view class="btn_new" @click.stop="editDemand(item)">
							{{ item.status === 0 ? '关闭' : item.status === 2 ? '删除' : '' }}
						</view>
					</view>
				</view>
				<uni-load-more v-if="demandList.length > 0" :status="listStatus"></uni-load-more>
				<view v-if="demandList.length === 0" class="empty-wrap">
					<image class="empty-img"
						src="https://xzcs-public-files.oss-cn-beijing.aliyuncs.com/static/coupon/contentVanshi.png"></image>
					<text class="tips">暂无内容</text>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script  type="text/javascript" src="plus-confusion://../enterpriseServer/myDemand/index"></script>

<style lang="scss" scoped>
@import 'index.scss';
</style>
